package com.hst.capacity.domain.model.entity.order.intercity;


import com.hst.capacity.domain.model.entity.BaseEntity;
import com.hst.capacity.domain.model.request.dispatch.DispatchDriverParam;
import com.hst.capacity.infra.util.StringUtil;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

@Data
@EqualsAndHashCode(callSuper=false)
@Entity
@Table(name = "om_intercity_order_dispatch")//快车订单司机调度记录
public class IntercityOrderDispatchEntity extends BaseEntity {

  @Id
  @GeneratedValue(generator = "gen_uuid")
  @GenericGenerator(name = "gen_uuid", strategy = "uuid")
  private String idOrderDispatch;
  private String idOrder;
  private String idDriver;
  private String dispatcher;

  public IntercityOrderDispatchEntity(){

  }
//  public IntercityOrderDispatchEntity(IntercityReDriveParam param){
//    this.idOrderDispatch = StringUtil.generateUuid();
//    this.idOrder=param.getIdOrder();
//    this.idDriver=param.getIdDriver();
//    this.dispatcher=param.getDispatcher();
//    setCreateBy(param.getDispatcher());
//  }

  public IntercityOrderDispatchEntity(DispatchDriverParam param){
    this.idOrderDispatch = StringUtil.generateUuid();
    this.idOrder=param.getIdOrder();
    this.idDriver=param.getIdDriver();
    this.dispatcher=param.getDispatcher();
    setCreateBy(param.getDispatcher());
  }


}
